home *** CD-ROM | disk | FTP | other *** search
/ Night Owl 6 / Night Owl's Shareware - PDSI-006 - Night Owl Corp (1990).iso / 026a / winyn.zip / WINYN.PRG
Text File  |  1991-07-22  |  1KB  |  63 lines

  1. function winyn
  2. parameters mess,choice_1,choice_2,top,left,titl
  3. *************************************************
  4. *MESS       =     MESSAGE TO DISPLAY IN THE BOX
  5. *CHOICE_1   =     FIRST OF THE 2 CHOICES
  6. *CHOICE_2   =     SECOND OF 2 CHOICES
  7. *TOP        =     TOP ROW OF WINDOW 
  8. *LEFT       =     LEFT COLUMN OF WINDOW
  9. *TITL       =     TITLE OF BOX
  10. *************************************************  
  11. SET TALK OFF
  12.  
  13. ****LOCAL VARIBLES
  14. private RET_VAR
  15.  
  16. RET_VAR = SPACE(5)
  17.  
  18. IF MESS = " "
  19.     MESS = "Please Choose:"
  20. endif
  21.  
  22. if choice_1 = " " .and. choice_2 = " "
  23.     choice_1 = "Yes"
  24.     choice_2 = "No"
  25. endif
  26.  
  27. choice_1 = " &choice_1 "
  28. choice_2 = " &choice_2 "
  29. mess = " &mess "
  30. winwidth = len(mess)+len(choice_1)+len(choice_2)+5
  31. if top = 99
  32.     top = 11
  33. endif
  34. bottom = top + 5
  35.  
  36. if left = 99
  37.     left =(80-winwidth)/2+winwidth
  38. endif
  39. define window winny from top,(80-winwidth)/2 to bottom,left panel
  40. activate window winny
  41. define menu men
  42. define pad men1 of men prompt choice_1 at 2,len(mess)+1
  43. define pad men2 of men prompt choice_2 at 2,len(mess)+len(choice_1)+1
  44.  
  45. if titl <> " "
  46.     @0,(winwidth-len(titl))/2 say titl
  47. endif
  48.  
  49. @ 2,0 say mess
  50. on selection pad men1 of men deactivate menu
  51. on selection pad men2 of men deactivate menu
  52. activate menu men
  53. deactivate window winny
  54. if pad() = "MEN1" 
  55.     store trim(choice_1) to ret_var
  56. endif
  57. if pad() = "MEN2"
  58.     store trim(choice_2) to ret_var
  59. endif
  60.  
  61.  
  62. return ret_var
  63.